import jsonpath


login_json = {"data":"success","data":{"msg":[123]}}
a = jsonpath.jsonpath(login_json, "$..msg")[0][0]
print(a)